<html>
  <head>

    <![CDATA[ <#include "../../common/handlefielderror.ftl" > ]]>
    <title></title>
    <link rel="stylesheet" href="${request.contextPath}/static/css/layout.css" type="text/css" />  
    <link rel="stylesheet" href="${request.contextPath}/static/css/extremecomponents.css" type="text/css"/>  
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <script type="text/javascript" src="../js/element.js" charset="utf-8"></script> 
    <script type="text/javascript" src="${request.contextPath}/static/js/validate.js"></script>
    <script type="text/javascript"> </script>
    <script type="text/javascript"> 
      <![CDATA[ 
      function add() {
        document.location = "${entityVar}Admin-add.action";
      }
      function edit(evt,${entityVar}Id) {
        var srcEl = evt.srcElement || evt.target;
        if (srcEl.tagName.toLowerCase() == "input")  {
          if(srcEl.type=='checkbox'){
              return false;
          }
        }
        document.location = "${entityVar}Admin-edit.action?${entityVar}Id=" + ${entityVar}Id;
      }
      function doDelete() {
          if(!checkSelectCheckbox(dataform,"${entityVar}Ids")) return;
          if(!confirm("您确认要删除信息吗？")) return;
          dataform.action = "${entityVar}Admin-delete.action";
          dataform.submit();
      }

      Event.observe(window, 'load', function() { 
        var bottomBtns = $$("input[btnclass='bottom']");
        initButtonCss(bottomBtns, "del_button3","del_button2","del_button1");

        var topBtns = $$("div[btnclass='top']");
        initButtonCss(topBtns, "head_button","head_button_down","head_button");

        initZebraTable("dataTable");
       
        Event.observe("addBtn", "click", add);
        Event.observe("delBtn", "click", doDelete);

      });

      ]]>
    </script>
  </head>
  <body>
    <form name="form1" id="dataform" action="" method="post">
        <input type="hidden" id="unitId" name="unitId" value=""></input>

      <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="YecSpec" height="100%">    
        <tr><td height="5"></td></tr>
        <tr>
          <td height="20" align="right" class="padding_right">
            <table width="80" align="right" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="80" style="padding-left:150px;">
                <div id="addBtn" btnclass="top">新增</div>
                </td>
              </tr>
            </table>
          </td>
        </tr> 
        <tr>
          <td height="100%" valign="top">
            <div class="eXtremeTable" >
              <table id="dataTable"  border="0"  cellspacing="0"  cellpadding="0"  class="tableRegion"  width="100%" >
                <thead>
                  <tr class="filter" >
                    <td width="30" ></td> <td></td> <td></td> <td></td> <td></td>
                  </tr>
                  <tr id="titleRow">
                    <td class="tableHeader"  width="30" >选择</td>
                    <!-- 标题列区 -->
                  </tr>
                </thead>
                <tbody class="tableBody" >
                <!-- 数据行区 --> 
                <![CDATA[ <#list ${entityVar}List as ${entityVar}> ]]>
                  <tr id="dataRow" onclick="edit(event,'${${entityVar}.id}');" >
                    <td width="30">
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td name="checkbox" width="100%">
                            <input type="checkbox" name="${entityVar}Ids" value="${${entityVar}.id}" />
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <![CDATA[ </#list> ]]>
                </tbody>
              </table>
            </div>
          </td>
         </tr>
        <tr style="height:0px;"><td id="actionTip"></td></tr>
        <tr><td bgcolor="#C2CDF7" height="1"></td></tr>
        <tr><td bgcolor="#ffffff" height="1"></td></tr>
        <tr><td>
            <table border="0"  cellpadding="0"  cellspacing="0"  width="100%" >
              <tr>
                <td bgcolor="#C2CDF7" height="32" class="padding_left">
                  <input type="checkbox" id="allSelect" onclick="checkAll();" ></input>
                  <label for="allSelect"><![CDATA[&nbsp;]]>全选<![CDATA[&nbsp;]]></label>
                  <input id="delBtn" btnclass="bottom" type='button' value='删除'></input>
                </td>
                <td bgcolor="#C2CDF7" height="32" class="padding_right">
                  ${htmlOfPagination}
                </td>
              </tr>
            </table>  
        </td></tr>
      </table>
    </form>
  </body>
</html>



